pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    let mut a: u32 = 0;
    let mut b: u32 = 1;

    match threshold {
        0 => 0,
        1 => 1,
        _ => {
            let mut sum;
            let mut result = 1;
            for _ in 2..=u32::MAX {
                sum = a + b;
                a = b;
                b = sum;
                if sum >= threshold {
                    break;
                }
                if sum % 2 != 0 {
                    result += sum;
                }
            }
            result
        }
    }
}
